package com.kx.game.center;


import com.kx.game.center.bean.UserBean;
import java.util.HashMap;
import java.util.Map;

public class test1 {
    public static void main(String[] args) {
        UserBean userBean1 = new UserBean();
        UserBean userBean2 = new UserBean();
        userBean1.setLevel("1");
        userBean2.setLevel("2");
        String key = "11";
        Map<String, UserBean> map = new HashMap<>();
        UserBean o1 = map.putIfAbsent(key, userBean1);
        UserBean o2 = map.put(key + 1, userBean2);
        System.out.println(o1);
        System.out.println(o2);
        map.forEach((k, v) -> System.out.println("k" + k + "   v" + v.getLevel()));
    }

}
